package ithema.StringJoiner;
import java.util.StringJoiner;
public class StringJoinerdemo2 {
    public static void main(String[] args) {
        //1.创建对象
        StringJoiner sj = new StringJoiner(",","[","]");
        int []arr={1,2,3};
        for (int i = 0; i < arr.length; i++) {
            sj.add(String.valueOf(arr[i]));
        }
        System.out.println(sj.toString());
    }
}
